package likou;

public class countSubarrays {
    public int countSubarrays(int[] nums) {
        int res=0;
        int n=nums.length;
        for(int i=1;i<n-1;i++){if((nums[i-1]+nums[i+1])*2==nums[i]) res++;}
        return res;
    }
}
